#include "api_config.h"
#if API_ENABLE_CONFIG_SETUP
#include "http_server.h"
#include "api_map.h"

void get_config_setup(http_server_t server, httpd_ws_frame_t *frame, void *data)
{
    uint16_t len = 0;
    char *str = (char *)server->data;
    len += sprintf(&str[len], "{");
    len += sprintf(&str[len], "\"api\":\"get_config_setup\",");
    len += sprintf(&str[len], "\"data\":{");
    len += sprintf(&str[len], "\"uart\":%s,", 0 ? "true" : "false");
    len += sprintf(&str[len], "\"i2c\":%s,", 0 ? "true" : "false");
    len += sprintf(&str[len], "\"spi\":%s,", 0 ? "true" : "false");
    len += sprintf(&str[len], "\"dap\":%s", 0 ? "true" : "false");
    len += sprintf(&str[len], "}");
    len += sprintf(&str[len], "}");
    frame->payload = server->data;
    frame->len = len;
}

static void get_config_init(void)
{
    ADD_API_ITEM(get_config_setup);
}
ADD_API(get_config_init)
#endif